import 'package:flutter/material.dart';
import 'package:macnov/models/company.dart';
import 'package:macnov/utils/Api.dart';
import 'package:mobx/mobx.dart';

// Include generated file
part 'company.g.dart';

// This is the class used by rest of your codebase
class CompanyStore = _CompanyStore with _$CompanyStore;

// The store-class
abstract class _CompanyStore extends ChangeNotifier with Store {
  @observable
  CompanyModel companyInfo = new CompanyModel('', '', '', '');

  @action
  Future getCompanySetting() async {
    var json = await Api.getCompanySetting();
    companyInfo = CompanyModel.fromJson(json);
  }
}

final CompanyStore companyStore = new CompanyStore();
